<div class="container">
    <form #formMy="ngForm" (submit) = "signup()" class="form-signin">
      <h2 class="form-signin-heading">注册</h2>
      <label for="inputEmail" class="sr-only">邮箱：</label>
      <input 
      type="email" 
      id="inputEmail" 
      name="email"
      class="form-control" 
      placeholder="Email address" 
      required 
      autofocus
      #email = "ngModel"
      email = 'true'
      [(ngModel)] = "siginupFrom.email">

      <!--<div [hidden]="email.valid || email.pristine"
        class="alert alert-danger">
        邮箱不能为空！
      </div>-->

      <div *ngIf = "err_email_msg" class="alert alert-danger">
        {{ err_email_msg }}
      </div>

      <div *ngIf="email.invalid && (email.dirty || email.touched)"
            class="alert alert-danger">
        <div *ngIf="email.errors.required">
             邮箱不能为空！
        </div>
        <div *ngIf="email.errors.email">
             无效邮箱！
        </div>
      </div>

      <label for="inputPassword" class="sr-only">密码：</label>
      <input 
      type="password" 
      id="inputPassword" 
      name="password"
      class="form-control" 
      placeholder="Password" 
      minlength="6"
      maxlength="12"
      password = 'true'
      required
      #password = "ngModel"
      [(ngModel)]="siginupFrom.password">
      <div *ngIf="password.invalid && (password.dirty || password.touched)"
            class="alert alert-danger">
        <div *ngIf="password.errors.required">
             密码不能为空！
        </div>
        <div *ngIf="password.errors.minlength">
             密码不能少于6位！
        </div>
        <div *ngIf="password.errors.maxlength">
             密码不能大于12位！
        </div>
      </div>
      <button [disabled]="!formMy.form.valid" class="btn btn-lg btn-primary btn-block" type="submit">立即注册</button>
    </form>
    <p class="info"><a routerLink="/sigin">立即登录</a></p>
  </div>